import org.junit.Test;

public class MainTest {
    import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
    public class MainTest {
        public boolean isBetween0To9(int[] data){
            for(int i = 0; i < data.length; i++){
                if (data[i] > 9 || data[i] < 0) {
                    return false;
                }
            }
            return true;
        }
        public boolean hasDuplicate(int [] data) {
            for(int i = 0; i < data.length; i++){
                for(int j = i + 1; j < data.length; j++){
                    if (data[i] == data[j]){
                        return false;
                    }
                }
            }
            return true;
        }
        @Test
        public void testGenerateAnswerLength(){
            NewGuessNumberGUI.generateAnswer();
            assertEquals(4, NewGuessNumberGUI.answers.length);
        }
        @Test
        public void testGenerateAnswerSize(){
            NewGuessNumberGUI.generateAnswer();
            assertTrue(isBetween0To9(NewGuessNumberGUI.answers));
        }
        @Test
        public void testGenerateAnswerDuplication(){
            NewGuessNumberGUI.generateAnswer();
            assertTrue(hasDuplicate(NewGuessNumberGUI.answers));
        }
    }
        }

